< previous page page_566 next page >

Page 566
0566-01.jpg
Figure 14.16.
Laying out the frmErrDialog form.
Only two events need to be coded for this form. The Form_Load event handles most of the dirty work. Listing 14.20 shows the code that you should add to the Form_Load event.
Type.gifListing 14.20. Coding the Form_Load event of the frmErrDialog form.
Private Sub Form_Load()
    '
    Dim intBtns As Integer
    Dim intLoop As Integer
    '
    txtErrMsg = udtErrDialog.Message
    Me.Caption = udtErrDialog.Title
    '
    intBtns = UBound(udtErrDialog.Buttons)
    For intLoop = 0 To intBtns
        cmdBtn(intLoop).Caption = udtErrDialog.Buttons(intLoop)
        cmdBtn(intLoop).Visible = True
        cmdBtn(intLoop).Top = Me.ScaleHeight - 420
        cmdBtn(intLoop).Left = 120 + (1300 * intLoop)
    Next
    '
    ' check for help file
    If udtErrDialog.HelpFile <> "" Then
        cmdBtn(3).Visible = True
        cmdBtn(3).Top = Me.ScaleHeight - 420
        cmdBtn(3).Left = 120 + (1300 * 3)
    End If
    '
End Sub

 
< previous page page_566 next page >

If you like this book, buy it!